package com.iemes.controller.pretest.datastatistics;

import java.util.List;
import java.util.Map;

import javax.inject.Inject;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.iemes.controller.index.BaseController;
import com.iemes.entity.PretesDailyProductionFormMap;
import com.iemes.mapper.pretest.PreDailyProductionMapper;
import com.iemes.plugin.PageView;
import com.iemes.util.Common;

//日生产报表
@RequestMapping("/dailyproduction")
@Controller
public class PreDailyProductionController extends BaseController{
	
	@Inject
	private PreDailyProductionMapper  predailyductionmapper;
	
	@RequestMapping("dailyproduction")
	public String dailyproduction(Model model){
		model.addAttribute("res", findByRes());
		return Common.BACKGROUND_PATH + "/pretest/datastatistics/predaily_list";
	}
	
	@ResponseBody
	@RequestMapping("dailyproduction_findByPage")
	public PageView findByPage(String pageNow, String pageSize) throws Exception
	{
		PretesDailyProductionFormMap dailyFormMap = getFormMap(PretesDailyProductionFormMap.class);
		List<Map<String, Object>> pretest = predailyductionmapper.getAll(dailyFormMap);
		
		LuogicPaging(pageNow, pageSize, pretest);
		pageView.setRecords(pretest);
		return pageView;
	}
	

}
